/*
 * @Author: your name
 * @Date: 2021-01-29 15:08:34
 * @LastEditTime: 2021-02-04 11:07:20
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \wechat-node\routes\news.js
 */
const router = require('koa-router')();
const {newsModel} = require('../model/news');

// 获取新闻
router.get('/news', async (ctx, next) => {
    await newsModel.getNews(ctx);
});
router.post('/news/comment', async (ctx, next) => {
    await newsModel.comment(ctx);
});
router.get('/news/comment', async (ctx, next) => {
    await newsModel.getComment(ctx);
});
router.post('/news/history', async (ctx, next) => {
    await newsModel.pointNews(ctx);
});

// // 增加新闻
// router.post('/add/news', async (ctx, next) => {
//     await newsModel.addNews(ctx);
// });
// // 删除新闻
// router.post('/delete/news', async (ctx, next) => {
//     await newsModel.deleteNews(ctx);
// });
// // 编辑新闻
// router.post('/edit/news', async (ctx, next) => {
//     await newsModel.editNews(ctx);
// });
module.exports = router;